﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using ZhouYu.NewWorld.BLL.IService;
using ZhouYu.NewWorld.DAL;
using ZhouYu.NewWorld.Model;
using ZhouYu.NewWorld.ViewModel;

namespace ZhouYu.NewWorld.BLL.Service
{
    public class BackcolumnService : BaseRepository<Backcolumn>, IBackcolumnService
    {
        #region 显示数据
        /// <summary>
        /// 显示数据
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public ResponseResult GetBackcolumnPageList(int page, int limit, string name)
        {
            ResponseResult result = new ResponseResult();
            result.code = 0;
            result.msg = string.Empty;
            int count = 0;
            Expression<Func<Backcolumn, bool>> Wherelambda = c => true;
            if (!string.IsNullOrEmpty(name))
            {
                Wherelambda = a => a.BackColumn_Name.Contains(name);
            }
            Expression<Func<Backcolumn, Nullable<int>>> OrderBylambda = c => c.BackColumn_Id;
            result.data =  QueryPageList(page, limit, Wherelambda, OrderBylambda, out count);
            result.count = count;
            return result;
        }
        #endregion
    }
}
